/* 全局重置样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body, html {
    margin: 0;
    padding: 0;
    width: 100%;
    height: 100%;
    overflow-x: hidden;
}

.face-login-container {
    min-height: 100vh;
    width: 100vw;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 0;
    margin: 0;
    position: relative;
    overflow: hidden;
    box-sizing: border-box;
}

/* 背景装饰元素 */
.background-decoration {
    position: absolute;
    top: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    z-index: 1;
}

.background-decoration-2 {
    position: absolute;
    bottom: -30px;
    left: -30px;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 50%;
    z-index: 1;
}

/* 主要内容区域 */
.main-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 40px 30px;
    width: calc(100% - 40px);
    max-width: 400px;
    margin: 20px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.1);
    position: relative;
    z-index: 2;
}

/* 返回按钮 */
.back-button {
    position: absolute;
    top: 20px;
    left: 20px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    color: #333;
}

.back-button:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.back-button:active {
    transform: scale(0.95);
}

/* 标题区域 */
.title-section {
    text-align: center;
    margin-bottom: 30px;
    margin-top: 20px;
}

.welcome-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin: 0 0 10px 0;
    background: linear-gradient(135deg, #667eea, #764ba2);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    font-size: 14px;
    color: #666;
    margin: 0;
}

/* 摄像头区域 */
.camera-section {
    margin-bottom: 30px;
    position: relative;
}

/* 绑定人脸提示 */
.bind-face-tip {
    background: rgba(255, 193, 7, 0.1);
    border: 1px solid rgba(255, 193, 7, 0.3);
    border-radius: 12px;
    padding: 20px;
    text-align: center;
    margin-bottom: 20px;
}

.bind-face-icon {
    font-size: 48px;
    margin-bottom: 15px;
}

.bind-face-text h3 {
    font-size: 18px;
    color: #856404;
    margin-bottom: 8px;
}

.bind-face-text p {
    font-size: 14px;
    color: #856404;
    margin-bottom: 15px;
    opacity: 0.8;
}

.bind-face-button {
    background: #ffc107;
    color: #333;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
}

.bind-face-button:hover {
    background: #e0a800;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 193, 7, 0.3);
}

/* 视频容器 */
.video-container {
    position: relative;
    width: 100%;
    height: 240px;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
    margin-bottom: 20px;
    border: 2px solid #e1e5e9;
}

.video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 状态覆盖层 */
.status-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
}

.status-content {
    text-align: center;
    color: white;
}

.loading-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top: 3px solid white;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin: 0 auto 15px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.status-text {
    font-size: 16px;
    font-weight: 500;
}

/* 错误信息 */
.error-message {
    background: rgba(220, 53, 69, 0.1);
    border: 1px solid rgba(220, 53, 69, 0.3);
    border-radius: 8px;
    padding: 12px;
    margin-bottom: 15px;
    color: #dc3545;
    font-size: 14px;
    text-align: center;
}

/* 操作按钮 */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

.start-button,
.recognize-button {
    padding: 12px 24px;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 120px;
}

.start-button {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
    color: white;
}

.start-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(40, 167, 69, 0.3);
}

.recognize-button {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.recognize-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 16px rgba(102, 126, 234, 0.3);
}

.recognize-button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* 分割线 */
.divider {
    display: flex;
    align-items: center;
    margin: 30px 0;
    color: #999;
    font-size: 14px;
}

.divider::before,
.divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e1e5e9;
}

.divider span {
    padding: 0 15px;
}

/* 其他登录方式 */
.other-login-methods {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.other-login-button {
    width: 100%;
    padding: 12px;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid #e1e5e9;
    border-radius: 12px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.other-login-button:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    border-color: #667eea;
}

.other-login-button:active {
    transform: translateY(0);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.main-content {
    animation: fadeInUp 0.6s ease-out;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .main-content {
        padding: 30px 20px;
        margin: 15px;
        width: calc(100% - 30px);
    }
    
    .welcome-title {
        font-size: 24px;
    }
    
    .back-button {
        top: 15px;
        left: 15px;
        width: 35px;
        height: 35px;
    }
    
    .title-section {
        margin-top: 15px;
    }
    
    .video-container {
        height: 200px;
    }
    
    .bind-face-icon {
        font-size: 36px;
    }
    
    .bind-face-text h3 {
        font-size: 16px;
    }
    
    .bind-face-text p {
        font-size: 13px;
    }
    
    .other-login-button {
        padding: 10px;
        font-size: 13px;
    }
}
